package com.gome.boot.common.util;

import java.net.InetAddress;
import java.net.UnknownHostException;

/**
 * 数据工具类.
 *
 * @author baoxiufeng
 */
public class DataUtils {

    /**
     * 获取IP地址.
     *
     * @return IP地址
     */
    public static String getIpAddr() {
        String ip = "";
        try {
            // 获取IP的方法
            ip = InetAddress.getLocalHost().getHostAddress();
        } catch (UnknownHostException e) {
            ;
        }
        return ip;
    }
}
